﻿using System;
using System.Reflection;

namespace Td.Additional.ComponentModel
{
    /// <summary>
    /// Property check attribute.
    /// </summary>
    public interface IPropertyCheckAttribute
    {
        /// <summary>
        /// Checks the specified property info.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="propertyInfo">The property info.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        String Check(Object owner, PropertyInfo propertyInfo, Object value);
    }

    /// <summary>
    /// Generic property check attribute.
    /// </summary>
    public interface IPropertyCheckAttribute<T> : IPropertyCheckAttribute
    {
        /// <summary>
        /// Checks the specified property info.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="propertyInfo">The property info.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        String Check(Object owner, PropertyInfo propertyInfo, T value);
    }
}